<?php

namespace App\Admin\Controllers\fund;

use App\Models\AdminFundNews;
use Dcat\Admin\Form;
use Dcat\Admin\Http\Controllers\AdminController;

class NewsController extends AdminController
{
    protected $title = "动态";

    protected $translation = 'admin-fund-news';

    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        return Form::make(new AdminFundNews(), function (Form $form) {
            $form->display('id');
            $form->hidden('fund_id') -> value(request('fund_id'));
            $form->text('title') -> required();
            $form->text('desc');
            $form->multipleImage('file_list') -> maxSize(5120) -> autoUpload() -> uniqueName();
            $form->datetime('show_time') -> default(now());
        });
    }
}
